package com.platform.api.film.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.platform.api.film.dao.FilmShortMapper;
import com.platform.api.film.model.FilmShort;
import com.platform.api.film.service.FilmShortService;
import com.platform.security.util.SecurityUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;


@Service
public class FilmShortServiceImpl extends ServiceImpl<FilmShortMapper, FilmShort> implements FilmShortService {

    @Override
    public boolean saveShort(FilmShort filmShort) {
        filmShort.setCreateTime(new Date());
        String userId = SecurityUtils.getUser().getUserId();
        filmShort.setUserId(userId);
        return saveOrUpdate(filmShort);
    }
}
